package com.webbei.HAO.action;

import java.util.ArrayList;
import java.util.List;

import net.sf.json.JSONArray;

import com.opensymphony.xwork2.ActionSupport;
import com.webbei.HAO.service.ChSer;
import com.webbei.pojo.Cartypes;

public class SendCarMark extends ActionSupport {
	private String CarName;
	private List<Cartypes> list;
	private ChSer ser;
	private JSONArray jsonob1;
	private List<String> strlist = new ArrayList<String>();

	public String execute(){
		list = ser.cartypeNamelist(CarName.trim());
		System.out.println(list.size());
		if (list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				strlist.add("CarMark/" + list.get(i).getTypesPic());
			}
		}
		jsonob1 = JSONArray.fromObject(strlist);
		return SUCCESS;
	}

	public JSONArray getJsonob1() {
		return jsonob1;
	}

	public void setJsonob1(JSONArray jsonob1) {
		this.jsonob1 = jsonob1;
	}

	public void setCarName(String carName) {
		CarName = carName;
	}

	public List<String> getStrlist() {
		return strlist;
	}

	public void setStrlist(List<String> strlist) {
		this.strlist = strlist;
	}

	public ChSer getSer() {
		return ser;
	}

	public void setSer(ChSer ser) {
		this.ser = ser;
	}

}
